package Student;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class number4 {
public static void main(String[] args) throws Exception {
	ArrayList<String> list = new ArrayList<String>();
	String line;
	Random random = new Random();
	int num = random.nextInt(40)+1;
	int num1 = num+10;
	BufferedReader reader = new BufferedReader(new FileReader("names.txt"));
	 while ((line = reader.readLine()) != null) {
         // 在这里处理每一行的内容，例如打印
         System.out.print(line+"   ");
         list.add(line);
         num++;
         if(num>=num1) {
        	 break;
         }
     }
	 int count = 0;
	 System.out.println("----------------------");
	 while (!list.isEmpty()) {
		 Collections.shuffle(list);
		 String student = list.remove(0); 
		 System.out.println("第 " + (count + 1) + " 次点名：" + student);
		 count++;
	 }
}
}
